package com.flesler.actoras.core
{
	import flash.events.Event;

	public final class ActorEvent extends Event
	{
		public static const ADDED:String = 'actorAdded';
		public static const MESSAGE_SENT:String = 'actorMessageSent';
		public static const MESSAGE_RECEIVED:String = 'actorMessageReceived';
		
		private var _actorName:String;
		private var obj:Object
		
		public function ActorEvent(type:String, obj:Object, actorName:String=null)
		{
			super(type);
			
			_actorName = actorName;
			this.obj = obj;
		}
		
		override public function clone():Event
		{
			return new ActorEvent(type, obj, _actorName);
		}
		
		public function get actorName():String
		{
			return _actorName;
		}
		
		public function get args():Array
		{
			return (obj as Array).slice();
		}
		
		public function get actor():Actor
		{
			return obj as Actor;
		}
		
	}
}